package cn.blog.service.impl;

import cn.blog.dao.BloggerDao;
import cn.blog.entity.Blogger;
import cn.blog.service.BloggerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("bloggerService")
public class BloggerServiceImpl implements BloggerService {

    @Resource
    private BloggerDao bloggerDao;

    public BloggerDao getBloggerDao() {
        return bloggerDao;
    }

    public void setBloggerDao(BloggerDao bloggerDao) {
        this.bloggerDao = bloggerDao;
    }

    @Override
    public Blogger getByUserName(String userName) {
        return bloggerDao.getByUserName(userName);
    }

    @Override
    public Blogger getByUserNameAndPassword(String username, String password) {
        return bloggerDao.getByUserNameAndPassword(username,password);
    }

    @Override
    public Integer update(Blogger blogger) {
        return bloggerDao.update(blogger);
    }

    @Override
    public Integer insert(Blogger blogger) {
        return bloggerDao.insert(blogger);
    }
}
